package com.coda.utils;

import java.util.Random;

public class CodeUtils {

    /**
     * 创建短信验证码
     */
    public static String getRandomCode(Integer length){
        Random random = new Random();
        StringBuilder stringBuilder = new StringBuilder();
        for (Integer i = 0; i < length; i++) {
            int number = random.nextInt(10);
            stringBuilder.append(number);
        }
        return stringBuilder.toString();
    }
}
